/* Level 1 Commands */
`define LCD_SWRESET             8'h01   /* Software Reset */
`define LCD_READ_DISPLAY_ID     8'h04   /* Read display identification information */
`define LCD_RDDST               8'h09   /* Read Display Status */
`define LCD_RDDPM               8'h0A   /* Read Display Power Mode */
`define LCD_RDDMADCTL           8'h0B   /* Read Display MADCTL */
`define LCD_RDDCOLMOD           8'h0C   /* Read Display Pixel Format */
`define LCD_RDDIM               8'h0D   /* Read Display Image Format */
`define LCD_RDDSM               8'h0E   /* Read Display Signal Mode */
`define LCD_RDDSDR              8'h0F   /* Read Display Self-Diagnostic Result */
`define LCD_SPLIN               8'h10   /* Enter Sleep Mode */
`define LCD_SLEEP_OUT           8'h11   /* Sleep out register */
`define LCD_PTLON               8'h12   /* Partial Mode ON */
`define LCD_NORMAL_MODE_ON      8'h13   /* Normal Display Mode ON */
`define LCD_DINVOFF             8'h20   /* Display Inversion OFF */
`define LCD_DINVON              8'h21   /* Display Inversion ON */
`define LCD_GAMMA               8'h26   /* Gamma register */
`define LCD_DISPLAY_OFF         8'h28   /* Display off register */
`define LCD_DISPLAY_ON          8'h29   /* Display on register */
`define LCD_COLUMN_ADDR         8'h2A   /* Colomn address register */
`define LCD_PAGE_ADDR           8'h2B   /* Page address register */
`define LCD_GRAM                8'h2C   /* GRAM register */
`define LCD_RGBSET              8'h2D   /* Color SET */
`define LCD_RAMRD               8'h2E   /* Memory Read */
`define LCD_PLTAR               8'h30   /* Partial Area */
`define LCD_VSCRDEF             8'h33   /* Vertical Scrolling Definition */
`define LCD_TEOFF               8'h34   /* Tearing Effect Line OFF */
`define LCD_TEON                8'h35   /* Tearing Effect Line ON */
`define LCD_MAC                 8'h36   /* Memory Access Control register*/
`define LCD_VSCRSADD            8'h37   /* Vertical Scrolling Start Address */
`define LCD_IDMOFF              8'h38   /* Idle Mode OFF */
`define LCD_IDMON               8'h39   /* Idle Mode ON */
`define LCD_PIXEL_FORMAT        8'h3A   /* Pixel Format register */
`define LCD_WRITE_MEM_CONTINUE  8'h3C   /* Write Memory Continue */
`define LCD_READ_MEM_CONTINUE   8'h3E   /* Read Memory Continue */
`define LCD_SET_TEAR_SCANLINE   8'h44   /* Set Tear Scanline */
`define LCD_GET_SCANLINE        8'h45   /* Get Scanline */
`define LCD_WDB                 8'h51   /* Write Brightness Display register */
`define LCD_RDDISBV             8'h52   /* Read Display Brightness */
`define LCD_WCD                 8'h53   /* Write Control Display register*/
`define LCD_RDCTRLD             8'h54   /* Read CTRL Display */
`define LCD_WRCABC              8'h55   /* Write Content Adaptive Brightness Control */
`define LCD_RDCABC              8'h56   /* Read Content Adaptive Brightness Control */
`define LCD_WRITE_CABC          8'h5E   /* Write CABC Minimum Brightness */
`define LCD_READ_CABC           8'h5F   /* Read CABC Minimum Brightness */
`define LCD_READ_ID1            8'hDA   /* Read ID1 */
`define LCD_READ_ID2            8'hDB   /* Read ID2 */
`define LCD_READ_ID3            8'hDC   /* Read ID3 */

/* Level 2 Commands */
`define LCD_RGB_INTERFACE       8'hB0   /* RGB Interface Signal Control */
`define LCD_FRMCTR1             8'hB1   /* Frame Rate Control (In Normal Mode) */
`define LCD_FRMCTR2             8'hB2   /* Frame Rate Control (In Idle Mode) */
`define LCD_FRMCTR3             8'hB3   /* Frame Rate Control (In Partial Mode) */
`define LCD_INVTR               8'hB4   /* Display Inversion Control */
`define LCD_BPC                 8'hB5   /* Blanking Porch Control register */
`define LCD_DFC                 8'hB6   /* Display Function Control register */
`define LCD_ETMOD               8'hB7   /* Entry Mode Set */
`define LCD_BACKLIGHT1          8'hB8   /* Backlight Control 1 */
`define LCD_BACKLIGHT2          8'hB9   /* Backlight Control 2 */
`define LCD_BACKLIGHT3          8'hBA   /* Backlight Control 3 */
`define LCD_BACKLIGHT4          8'hBB   /* Backlight Control 4 */
`define LCD_BACKLIGHT5          8'hBC   /* Backlight Control 5 */
`define LCD_BACKLIGHT7          8'hBE   /* Backlight Control 7 */
`define LCD_BACKLIGHT8          8'hBF   /* Backlight Control 8 */
`define LCD_POWER1              8'hC0   /* Power Control 1 register */
`define LCD_POWER2              8'hC1   /* Power Control 2 register */
`define LCD_VCOM1               8'hC5   /* VCOM Control 1 register */
`define LCD_VCOM2               8'hC7   /* VCOM Control 2 register */
`define LCD_NVMWR               8'hD0   /* NV Memory Write */
`define LCD_NVMPKEY             8'hD1   /* NV Memory Protection Key */
`define LCD_RDNVM               8'hD2   /* NV Memory Status Read */
`define LCD_READ_ID4            8'hD3   /* Read ID4 */
`define LCD_PGAMMA              8'hE0   /* Positive Gamma Correction register */
`define LCD_NGAMMA              8'hE1   /* Negative Gamma Correction register */
`define LCD_DGAMCTRL1           8'hE2   /* Digital Gamma Control 1 */
`define LCD_DGAMCTRL2           8'hE3   /* Digital Gamma Control 2 */
`define LCD_INTERFACE           8'hF6   /* Interface control register */

/* Extend register commands */
`define LCD_POWERA              8'hCB   /* Power control A register */
`define LCD_POWERB              8'hCF   /* Power control B register */
`define LCD_DTCA                8'hE8   /* Driver timing control A */
`define LCD_DTCB                8'hEA   /* Driver timing control B */
`define LCD_POWER_SEQ           8'hED   /* Power on sequence register */
`define LCD_3GAMMA_EN           8'hF2   /* 3 Gamma enable register */
`define LCD_PRC                 8'hF7   /* Pump ratio control register */
/*PARAMETER		*/
`define LCD_POWERA_PARAMETER1	8'h39
`define LCD_POWERA_PARAMETER2	8'h2C
`define LCD_POWERA_PARAMETER3	8'h00
`define LCD_POWERA_PARAMETER4	8'h34
`define LCD_POWERA_PARAMETER5	8'h02

`define LCD_POWERB_PARAMETER1	8'h00 
`define LCD_POWERB_PARAMETER2 	8'h83
`define LCD_POWERB_PARAMETER3	8'h30

`define LCD_DTCA_PARAMETER1		8'h85
`define LCD_DTCA_PARAMETER2		8'h01
`define LCD_DTCA_PARAMETER3		8'h79

`define LCD_DTCB_PARAMETER1		8'h00
`define LCD_DTCB_PARAMETER2		8'h00

`define LCD_POWER_SEQ_PARAMETER1	8'h64
`define LCD_POWER_SEQ_PARAMETER2	8'h03
`define LCD_POWER_SEQ_PARAMETER3	8'h12
`define LCD_POWER_SEQ_PARAMETER4	8'h81

`define LCD_PRC_PARAMETER1		8'h20

`define LCD_POWER1_PARAMETER1	8'h09 //8'h1B 

`define LCD_POWER2_PARAMETER1	8'h11

`define LCD_VCOM1_PARAMETER1	8'h35
`define LCD_VCOM1_PARAMETER2	8'h3E

`define LCD_VCOM2_PARAMETER1	8'hBE

`define LCD_MAC_PARAMETER1		8'h88

`define LCD_PIXEL_FORMAT_PARAMETER1	8'h55

`define LCD_FRMCTR1_PARAMETER1	8'h00
`define LCD_FRMCTR1_PARAMETER2	8'h1B

`define LCD_DFC_PARAMETER1	8'h0A
`define LCD_DFC_PARAMETER2	8'h82  
//`define LCD_DFC_PARAMETER2	8'hC2    //by xhy 2020/3/4
`define LCD_DFC_PARAMETER3	8'h27
`define LCD_DFC_PARAMETER4	8'h00

`define LCD_3GAMMA_EN_PARAMETER1	8'h00

`define LCD_GAMMA_PARAMETER1	8'h01

`define LCD_PGAMMA_PARAMETER1	8'h0F
`define LCD_PGAMMA_PARAMETER2	8'h2A	//
`define LCD_PGAMMA_PARAMETER3	8'h28	//
`define LCD_PGAMMA_PARAMETER4	8'h08
`define LCD_PGAMMA_PARAMETER5	8'h0E	//
`define LCD_PGAMMA_PARAMETER6	8'h08	
`define LCD_PGAMMA_PARAMETER7	8'h54	//
`define LCD_PGAMMA_PARAMETER8	8'hA9	//
`define LCD_PGAMMA_PARAMETER9	8'h43	//
`define LCD_PGAMMA_PARAMETER10	8'h0A
`define LCD_PGAMMA_PARAMETER11	8'h0F	//
`define LCD_PGAMMA_PARAMETER12	8'h00
`define LCD_PGAMMA_PARAMETER13	8'h00	//
`define LCD_PGAMMA_PARAMETER14	8'h00	//
`define LCD_PGAMMA_PARAMETER15	8'h00

`define LCD_NGAMMA_PARAMETER1	8'h00
`define LCD_NGAMMA_PARAMETER2	8'h15	//
`define LCD_NGAMMA_PARAMETER3	8'h17	//
`define LCD_NGAMMA_PARAMETER4	8'h07
`define LCD_NGAMMA_PARAMETER5	8'h11	//
`define LCD_NGAMMA_PARAMETER6	8'h06	
`define LCD_NGAMMA_PARAMETER7	8'h2B	//
`define LCD_NGAMMA_PARAMETER8	8'h56	//
`define LCD_NGAMMA_PARAMETER9	8'h3C	//
`define LCD_NGAMMA_PARAMETER10	8'h05
`define LCD_NGAMMA_PARAMETER11	8'h10	//
`define LCD_NGAMMA_PARAMETER12	8'h0F
`define LCD_NGAMMA_PARAMETER13	8'h3F	//
`define LCD_NGAMMA_PARAMETER14	8'h3F	//
`define LCD_NGAMMA_PARAMETER15	8'h0F

`define	LCD_PAGE_ADDR_START		16'h011A
`define	LCD_PAGE_ADDR_END		16'h013F
`define	LCD_COLUMN_ADDR_START	16'h00DE
`define	LCD_COLUMN_ADDR_END		16'h00EF

`define	BGcolor					16'b00010_000100_00010   // 16'b00010_000010_00010 
`define	Fontcolor				16'b01000_001100_11010   //16'b01000_010100_11101//16'b10000_100100_11000  
`define	FillBGcolor				16'b00101_001001_00110	//16'b00110_001010_00110//16'b01101_011100_10010
`define	FillFontcolor			16'b11111_111111_11111

`define	Fontcolor_WAITING_CENTER	16'hF800
`define Fontcolor_INTO_ERROR_RANGE	16'h07E0
`define Fontcolor_REACH_CENTER 		16'hFFFF